//
//  ProductOfferRecordViewController.m
//  MyNewProject
//
//  Created by ZhangYuan on 2019/1/28.
//  Copyright © 2019年 sun. All rights reserved.
//

#import "ProductOfferRecordViewController.h"
#import "ProductOfferRecordListCell.h"
@interface ProductOfferRecordViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic , retain)UITableView * tableList;
@property(nonatomic , retain)NSMutableArray * dataArray;

@end
@implementation ProductOfferRecordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = BackColor;
    self.gk_navigationBar.hidden = NO;
    self.gk_navTitle = @"出价记录";
    [self.view addSubview:self.tableList];
    //请求数据
    [self postProductInfomation];
}
-(void)postProductInfomation{
    
}

#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [self.dataArray count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 85;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"ProductOfferRecordListCell";
    ProductOfferRecordListCell *cell = (ProductOfferRecordListCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if (cell == nil) {
        cell = [[ProductOfferRecordListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    [cell LoadProductInfomation:@{} andType:indexPath.row == 0?1:0];
    return cell;
}
#pragma mark - Table view delegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
}

#pragma -makr Setter
-(UITableView *)tableList{
    if (!_tableList) {
        _tableList = [[UITableView alloc]initWithFrame:CGRectMake(0, IS_IPhoneX_All?88:64, SCREEN_WIDTH, SCREENH_HEIGHT  - SKBottomSafe_Height  - (IS_IPhoneX_All?88:64))  style:UITableViewStylePlain];
        _tableList.dataSource = self;
        _tableList.delegate = self;
        _tableList.showsVerticalScrollIndicator = NO;
        _tableList.showsHorizontalScrollIndicator = NO;
        _tableList.separatorStyle = UITableViewCellSelectionStyleNone;
    }
    return  _tableList;
}

-(NSMutableArray *)dataArray{
    if (!_dataArray) {
        _dataArray = [NSMutableArray arrayWithArray:@[@"供应商",@"开始时间",@"结束时间",@"封顶成交价",@"市场参考价",@"出价记录",@"竞购规则",@"商品介绍"]];
    }
    return _dataArray;
}
@end
